CC Mode determines whether to insert auto-newlines in two basically different ways, depending on the character just typed:
c-hanging-semi&comma-criteria
contains a list of functions which determine whether to insert
a newline after a newly typed semicolon or comma. See
Hanging Semicolons and Commas.The names of these configuration variables contain ‘hanging’ because they let you hang the pertinent characters. A character which introduces a C construct is said to hang on the right when it appears at the end of a line after other code, being separated by a line break from the construct it introduces, like the opening brace in:
while (i < MAX) {
total += entry[i];
entry [i++] = 0;
}
A character hangs on the left when it appears at the start of the line after the construct it closes off, like the above closing brace.
The next chapter, “Clean-ups”, describes how to configure CC Mode to remove these automatically added newlines in certain specific circumstances. See Clean-ups.